package vcp.entity;

import java.awt.Color;
import java.io.Serializable;

import org.joda.time.DateTime;

import vcp.enums.LotStatus;
import vcp.enums.SiteEnum;
/**
 * <p> lot class includes getters and setters </p>
 * @author VCP team
 *
 */
public class Lot implements Serializable, Cloneable
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 8001304416023360417L;

	private SiteEnum siteEnum;

	/**
	 * getter
	 * @return site enum
	 */
	public SiteEnum getSiteEnum()
	{
		return this.siteEnum;
	}
	/**
	 * setter
	 * @param siteEnum
	 */
	public void setSiteEnum(SiteEnum siteEnum)
	{
		this.siteEnum = siteEnum;
	}
	/**
	 * getter
	 * @return site id
	 */
	public int getSiteID ()
	{
		return this.parentSite.getSiteID();
	}

	private int floor;
	/**
	 * getter
	 * @return floor
	 */
	public int getFloor ()
	{
		return this.floor;
	}
	/**
	 * setter
	 * @param floor
	 */
	public void setFloor ( int floor )
	{
		this.floor = floor;
	}

	private int row;
	/**
	 * getter
	 * @return row
	 */
	public int getRow ()
	{
		return this.row;
	}
	/**
	 * setter
	 * @param row
	 */
	public void setRow ( int row )
	{
		this.row = row;
	}

	private int column;
	/**
	 * getter
	 * @return column
	 */
	public int getColumn ()
	{
		return this.column;
	}
	/**
	 * setter
	 * @param column
	 */
	public void setColumn ( int column )
	{
		this.column = column;
	}

	private Site parentSite;
	/**
	 * getter
	 * @return parent site
	 */
	public Site getParentSite ()
	{
		return this.parentSite;
	}
	/**
	 * setter
	 * @param parentSite
	 */
	public void setParentSite ( Site parentSite )
	{
		this.parentSite = parentSite;
	}

	private LotStatus lotStatus;
	/**
	 * getter
	 * @return lot status
	 */
	public LotStatus getLotStatus ()
	{
		return this.lotStatus;
	}
	/**
	 * setter
	 * @param lotStatus
	 */
	public void setLotStatus ( LotStatus lotStatus )
	{
		this.lotStatus = lotStatus;
	}
	/**
	 * getter
	 * @return status name
	 */
	public String getStatusName ()
	{
		return this.lotStatus.toString();
	}
	/**
	 * getter
	 * @return status color
	 */
	public Color getStatusColor ()
	{
		return this.lotStatus.getStateColor();
	}

	private Integer carID;
	/**
	 * getter
	 * @return car id
	 */
	public Integer getCarID ()
	{
		return this.carID;
	}
	/**
	 * setter
	 * @param carID
	 */
	public void setCarID ( Integer carID )
	{
		this.carID = carID;
	}

	private Integer reservedBySubscription;
	/**
	 * getter
	 * @return reserved by subscription
	 */
	public Integer getReservedBySubscription ()
	{
		return this.reservedBySubscription;
	}
	/**
	 * setter
	 * @param reservedBySubscription
	 */
	public void setReservedBySubscription ( Integer reservedBySubscription )
	{
		this.reservedBySubscription = reservedBySubscription;
	}

	private DateTime brokeStartDate;
	/**
	 * getter
	 * @return damage start date
	 */
	public DateTime getBrokeStartDate ()
	{
		return this.brokeStartDate;
	}
	/**
	 * setter
	 * @param brokeStartDate
	 */
	public void setBrokeStartDate ( DateTime brokeStartDate )
	{
		this.brokeStartDate = brokeStartDate;
	}

	private DateTime brokeEndDate;
	/**
	 * getter
	 * @return damage end date
	 */
	public DateTime getBrokeEndDate ()
	{
		return this.brokeEndDate;
	}
	/**
	 * setter
	 * @param brokeEndDate
	 */
	public void setBrokeEndDate ( DateTime brokeEndDate )
	{
		this.brokeEndDate = brokeEndDate;
	}

	private boolean changed;

	/**
	 * getter
	 * @return true if changed
	 */

	public boolean isChanged() {
		return this.changed;
	}
	/**
	 * setter
	 * @param changed
	 */
	public void setChanged(boolean changed) {
		this.changed = changed;
	}
	/**
	 * creates copy of lot
	 * @return lot
	 */
	public Lot copyLot ()
	{
		Lot copiedLot = null;
		try
		{
			copiedLot = (Lot) super.clone();
		}
		catch ( CloneNotSupportedException e )
		{
			e.printStackTrace();
		}
		return copiedLot;
	}

}
